create  table jms_dm.dm_end_dispatch_store_level_detail_dt 
(
    virt_code varchar(50) NULL COMMENT "虚拟代理区code",
    agent_code varchar(50) NULL COMMENT "代理区编码",
    network_code varchar(50) NULL COMMENT "网点编码",
    score_level varchar(50) NULL COMMENT "驿站等级",
    agent_name varchar(100) NULL COMMENT "代理区名称",
    franchisee_code varchar(50) NULL COMMENT "加盟商code",
    franchisee_name varchar(100) NULL COMMENT "加盟商name",
    virt_name varchar(100) NULL COMMENT "虚拟代理区name",
    network_name varchar(100) NULL COMMENT "网点名称",
    store_code varchar(50) NULL COMMENT "门店code",
    store_name varchar(100) NULL COMMENT "门店name",
    build_type varchar(100) NULL COMMENT "建设类型",
    index_name varchar(100) NULL COMMENT "指标名称",
    index_value decimal(20, 10) NULL COMMENT "指标值（率值、）",
    index_score decimal(16, 2) NULL COMMENT "指标得分",
    store_score decimal(16, 2) NULL COMMENT "驿站得分",
    date_time date NULL COMMENT "查询日期",
    business_id varchar(50) NULL COMMENT "品牌id",
    business_name varchar(100) NULL COMMENT "品牌名稱"
)
ENGINE=OLAP
DUPLICATE KEY(`virt_code`, `agent_code`, `network_code`, `score_level`)
comment '末端驿站分层明细'
PARTITION BY RANGE (date_time) ( 
   START ("2023-07-01") END ("2023-07-23") EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(`network_code`) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-180",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);